<?php

/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-10 16:05:46
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-03-10 16:18:24
 */
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use common\widgets\MyActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\DdCategory */
/* @var $form yii\widgets\MyActiveForm */
?>

<div class="dd-category-form">

    <?php $form = MyActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]); ?>

    <?= $form->field($model, 'parent_id')->dropDownList(ArrayHelper::map($catedata, 'category_id', 'name')); ?>

    <?= $form->field($model, 'image_id')->hint('尺寸:100px*100px')->widget('common\widgets\webuploader\FileInput', []); ?>
    <?= $form->field($model, 'sort')->textInput(); ?>


    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <?= Html::submitButton('保存', ['class' => 'btn btn-success']); ?>
        </div>
    </div>

    <?php MyActiveForm::end(); ?>

</div>